package com.example.web.merchant.service.impl;

import com.example.web.merchant.MerchantRequestParams;
import com.example.web.merchant.mapper.MerchantMapper;
import com.example.web.merchant.pojo.Merchant;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MerchantServicelmpl implements MerchatService {
    @Resource
    private MerchantMapper merchantMapper;

    @Override
    public int add(MerchantRequestParams merchantRequestParams) {
        return merchantMapper.add(merchantRequestParams);
    }

    @Override
    public Merchant findMerchant(String mname) {
        return merchantMapper.findByMname(mname);
    }

    @Override
    public Merchant login(MerchantRequestParams merchantRequestParams) {
        return merchantMapper.login(merchantRequestParams);
    }

    @Override
    public int update(Merchant merchantRequestParams) {
        return merchantMapper.update(merchantRequestParams);
    }

    @Override
    public List<Merchant> list() {
        return merchantMapper.list();
    }
    @Override
    public int updateStatusBymId(Integer mid){
        return merchantMapper.updateStatusBymId(mid);
    }

    @Override
    public int updateStatusByMid(Integer mid){
        return merchantMapper.updateStatusByMid(mid);
    }

    @Override
    public List<Merchant> findByCondition(String mrealname) {
        return merchantMapper.findByCondition(mrealname);
    }

}


